<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="language" content="pt" />

        <!-- blueprint CSS framework -->
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" />
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" />
        <!--[if lt IE 8]>
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
	<![endif]-->

        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/tabelas.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/tipTip.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/thickbox.css" />

        <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery-1.6.1.js" ></script>
        <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery-latest.js" ></script>
        <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery.tipTip.js" ></script>
        <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery.meio.mask.js" ></script>
        <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/thickbox.js" ></script>
        <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/comum.js" ></script>
        <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/browser-detect.js" ></script>
        <title><?php echo CHtml::encode($this->pageTitle); ?></title>
    </head>

    <body>

        <div class="container" id="page">

            <div id="header">
                <div id="logo">
                    <?php echo CHtml::encode(Yii::app()->name); ?>
                    <a href="http://www.inf.ufrgs.br">
                        <img id="logoINF" src="<?php echo Yii::app()->request->baseUrl.'/images/inf.png'?>" />
                    </a>
                </div>
            </div><!-- header -->
            <div id="mainmenu">
                <?php 
                    $isAdmin = Yii::app()->user->getState("identity") == null ? false : Yii::app()->user->getState("identity")->isAdmin();
                    $id = Yii::app()->user->getState("identity") == null ? -1 : Yii::app()->user->getState("identity")->getId();
                    $this->widget('application.extensions.mbmenu.MbMenu',array(
			'items'=>array(
                            array('label'=>'Início', 'url'=>array('/site/index')),
                            array('label'=>'Consulta',  '','visible'=>true, 'items'=>array(
                                array('label'=>'Alocações', 'url'=>array('/consulta/sala'), 'tag'=>'Alocações'),
                                array('label'=>'Ambientes', 'url'=>array('/ambiente/consulta'), 'tag'=>'Ambientes'),
                            )),
                            //array('label'=>'Nova Alocação', 'url'=>array('/alocacao/create'), 'visible'=>!$isAdmin),
                            array('label'=>'Meus Dados', 'url'=>array('/usuario/view&id='.$id), 'visible'=>!Yii::app()->user->isGuest),
                            array('label'=>'Usuários', 'url'=>array('/usuario/admin'), 'visible'=>$isAdmin),
                            array('label'=>'Alocações', 'url'=>array('/alocacao/admin'), 'visible'=>$isAdmin),
                            array('label'=>'Cadastros', '', 'visible'=>$isAdmin, 'items'=>array(
                                array('label'=>'Perfil', 'url'=>array('/perfil_Usuario/admin'), 'tag'=>'Perfis'),
                                array('label'=>'Ambiente', 'url'=>array('/ambiente/admin'), 'tag'=>'Ambientes'),
                                array('label'=>'Prédio', 'url'=>array('/predio/admin'), 'tag'=>'Prédios'),
                                array('label'=>'Recurso', 'url'=>array('/recurso/admin'), 'tag'=>'Recursos'),
                                array('label'=>'Uso', 'url'=>array('/uso/admin'), 'tag'=>'Usos'),
                                array('label'=>'Disciplina', 'url'=>array('/disciplina/admin'), 'tag'=>'Disciplinas'),
                            )),
                            array('label'=>'Carga Semestral', 'url'=>array('/template/admin'), 'visible'=>$isAdmin),
                            array('label'=>'Login', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
                            array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest)
			),
                    )); 
                ?>
            </div><!-- mainmenu -->
            <?php if (isset($this->breadcrumbs)): ?>
                <?php
                $this->widget('zii.widgets.CBreadcrumbs', array(
                    'homeLink' => CHtml::link('Início', Yii::app()->homeUrl),
                    'links' => $this->breadcrumbs,
                ));
                ?><!-- breadcrumbs -->
                <?php endif ?>

<?php echo $content; ?>

            <div id="footer">
		Desenvolvido por Leandro Vasconcelos - Trabalho de Graduação 2011.<br/>
            </div><!-- footer -->

        </div><!-- page -->

    </body>
</html>